<div align="left"><b><?=translate('title');?></b><br><br></div>
<?
//error_reporting(E_ALL);

#include('../rp2/global_functions.php');
#include('../rp2/mail_functions.php');
#include('../rp2/functions.php');
#
#include('wallet_db.html');

$wallet_acc_total_amount=translate('wallet_acc_total_amount');
$wallet_acc_total_amount_empty=translate('wallet_acc_total_amount_empty');
$coupon_code_not_valid=translate('coupon_code_not_valid');
$coupon_currency_mis=translate('coupon_currency_mis');
$wallet_availability=translate('wallet_availability');
$wallet_empty=translate('wallet_empty');
$database_error=translate('database_error');
$refill_acc_message=translate('refill_acc_message');
$credit_card=translate('credit_card');
$card_type_select=translate('card_type_select');
$amount_to_transfer=translate('amount_to_transfer');
$discount_code=translate('discount_code');
$submit=translate('submit');
$bank_wire=translate('bank_wire');
$card_type_sel=translate('card_type_sel');
$percentage_added=translate('percentage_added');
$ends_at=translate('ends_at');
$starts_at=translate('starts_at');
$amount_example=translate('amount_example');
$table_of_deposits=translate('table_of_deposits');
$no_refund=translate('no_refund');
$min_total_price=translate('min_total_price');

if (isset($error_msg)) {
	switch ($error_msg) {
		case '1':
//			echo "<h4><font color=red>$wallet_acc_total_amount_empty</font></h4>";
			$errorMsg = translate('wallet_acc_total_amount_empty');
			include_once('errorMsg.html');
			break;
		case '2':
//			echo "<h4><font color=red>$wallet_acc_total_amount</font></h4>";
			$errorMsg = translate('wallet_acc_total_amount');
			include_once('errorMsg.html');
			break;
		case '3':
//			echo "<h4><font color=red>$coupon_code_not_valid</font></h4>";
			$errorMsg = translate('coupon_code_not_valid');
			include_once('errorMsg.html');
			break;
		case '4':
//			echo "<h4><font color=red>$coupon_currency_mis<font></h4>";
			$errorMsg = translate('coupon_currency_mis');
			include_once('errorMsg.html');
			break;
		case '5':
//			echo "<h4><font color=red>$database_error</font></h4>";
			$errorMsg = translate('database_error');
			include_once('errorMsg.html');
			break;
		case '6':
//			echo "<h4><font color=red>$min_total_price</font></h4>";
			$errorMsg = translate('min_total_price');
			include_once('errorMsg.html');
			break;
	}	
}
echo "<SCRIPT>
function showHideCC(){
    var pm = document.getElementById('processor');
    var cc =document.getElementById('cc_selection');
    if(pm.checked){
        cc.style.display='block';
    }else {
        cc.style.display='none';
    }
}
function check_price (obj) {
	if (obj.total_price.value != \"\") return true;
	else {
		alert(\"Please fill in total price\");
		return false;
	}
}

</SCRIPT>";

//------------------------------------------------------
$sql['type']='SELECT';
$sql['params']='*';
$sql['table']='wallet';
$sql['where']="reseller_id='$id' and approved!='f'";
$sql['options']='ORDER BY currency ASC';
$sql['return']='struct';
//------------------------------------------------------
if ($result=sql_exec($sql,$dbh81,'assoc')) {
        echo "$wallet_availability";
        foreach ($result as $value) {
                echo "<b>$value[amount] $value[currency]</b> ";
        }
} else {
//	echo "<h4>$wallet_empty</h4>";
			$errorMsg = translate('wallet_empty');
			include_once('errorMsg.html');
}


//------------------------------------------------------
        $sql['type']='SELECT';
        $sql['params']='curr';
        $sql['table']='currency';
        $sql['where']="";
        $sql['options']='';
        $sql['return']='struct';
//------------------------------------------------------
if ($result=sql_exec($sql,$dbh81,'assoc')){
	$currency=array();
        foreach($result as $val) {
                $currency[]=$val['curr'];
        }
} else {
//        echo "<h4><font color=red>$database_error</font></h4>";
			$errorMsg = translate('database_error');
			include_once('errorMsg.html');
}

echo "<p>$refill_acc_message</p>";
$params[sid] = $sid;
$params[action] = "walletAccountRefill";
$url = "$baseURL/?".encode_params($params);
echo "<table class='bTable' cellspacing=0>
<form action=\"$url\" method=\"POST\" onSubmit=\"return check_price(this)\">
<tr>
        <th colspan=2>$credit_card</th>
</tr>
<tr>
        <td align=right valign=top width=50%><b>$card_type_select</b></td>
        <td valign=top width=50%>
		<input type=radio id=processor name='processor' value='' onClick='showHideCC()' checked>Credit Card
		<input type=radio name='processor' value='paypal' onClick='showHideCC()'>Paypal<br><br>
		<div id='cc_selection'>
        		$card_type_sel<br>
        		<select name='ccType'>
            			<option value='MSCD'>Mastercard</option>
            			<option value='VISA'>Visa</option>
            			<option value='VISD'>Visa Delta</option>
            			<option value='VISP'>Visa Purchasing</option>
        		</select>
        	</div>
        </td>
</tr>
<tr>
        <td align=right valign=top width=50%><b>$amount_to_transfer</b></td>
        <td valign=top width=50%><input type=text name=total_price size=6 maxlength=5 value=\"$_POST[total_price]\">&nbsp;";
        echo "<input type=hidden name=\"currency\" value=\"USD\">";
        #echo "<select name=currency>";
        //------------------------------------------------------
        #$sql['type']='SELECT';
        #$sql['params']='curr';
        #$sql['table']='currency';
        #$sql['where']="";
        #$sql['options']='';
        #$sql['return']='struct';
        //------------------------------------------------------
        #if ($result=sql_exec($sql,$dbh81,'assoc')){
        #       $currency=array();
        #        foreach($result as $value) {
        #                $currency[]=$value[curr];
        #        }
        #} else {
        #        exit('fadrf');
        #}
        #foreach ($currency as $v) {
        #       $ch=($v=='USD')?'selected':'';
        #       echo "<option value=\"$v\" $ch>$v</option>\n";
        #}
        #echo "</select></td>";
        echo "</td>
</tr>
        <td align=right valign=top width=50%><b>$discount_code</b></td>
        <td valign=top width=50%><input type=text name=code size=11 maxlength=10 value=\"$_POST[code]\"></td>
</tr>
<tr>
        <td colspan=2 align=center>$no_refund</td>
</tr>
<tr>
        <td colspan=2 align=center><input type=submit name=submit value=\"$submit\">
                <input type=hidden name=hid_sub_var value=415></td>
</tr></form> ";
/* echo "<tr>
        <td colspan=2 align=center>&nbsp;</td>
</tr>
<tr>
        <th colspan=2>$bank_wire</th>
</tr>
<tr>
        <td colspan=2 align=center><b>- Domestic Wire Transfers -</b></td>
</tr>
<tr>
        <td align=right valign=top width=50%>To:&nbsp;&nbsp;</td>
        <td valign=top width=50%><b>SIL VLY BK SJ</b></td>
</tr>
<tr>
        <td align=right valign=top>Routing and transit #:&nbsp;&nbsp;</td>
        <td valign=top><b>121140399</b></td>
</tr>
<tr>
        <td align=right valign=top>For Credit of:&nbsp;&nbsp;</td>
        <td valign=top><b>eNom, Inc.</b></td>
</tr>
        <tr><td align=right valign=top>Credit Account #:&nbsp;&nbsp;</td>
        <td valign=top><b>3300381976</b></td>
</tr>
<tr>
        <td align=right valign=top>By order of:&nbsp;&nbsp;</td>
        <td valign=top><b>(your name) and (your eNom Login ID)</b></td>
</tr>
<tr>
        <td colspan=2 align=center><br><b>- International Wire Transfers -</b></td>
</tr>
<tr>
        <td align=right valign=top width=50%>SWIFT Code:&nbsp;&nbsp;</td>
        <td valign=top width=50%><b>SVBKUS6S</b></td>
</tr>
<tr>
        <td align=right valign=top width=50%>Pay To:&nbsp;&nbsp;</td>
        <td valign=top width=50%><b>FC - Silicon Valley Bank<br>3003 Tasman Drive<br>Santa Clara, CA 95054, USA</b></td>
</tr>
<tr>
        <td align=right valign=top>Routing and transit #:&nbsp;&nbsp;</td>
        <td valign=top><b>\\FW:121140399</b></td>
</tr>
<tr>
        <td align=right valign=top>For Credit of:&nbsp;&nbsp;</td>
        <td valign=top><b>eNom, Inc.</b></td>
</tr>
<tr>
        <td align=right valign=top>Credit Account #:&nbsp;&nbsp;</td>
        <td valign=top><b>FNC - 3300381976</b></td>
</tr>
<tr>
        <td align=right valign=top>By order of:&nbsp;&nbsp;</td>
        <td valign=top><b>(your name) and (your eNom Login ID)</b></td>
</tr>
<tr>
        <td colspan=2><br><b>There are no minimum amounts for wire transfer refills.</b><br><b>Also, send details of your wire transfer</b> including login, amount and date initiated to: <a href=mailto:accounting@enom.com>accounting@enom.com</a><br><br></td>
</tr>"; */
echo "</table>
<br>
<table  class='bTable' cellspacing=0>
  <tr>
    <th colspan=3>$table_of_deposits</th>
  </tr>
  <tr>
    <th width='25%'>$starts_at</th>
    <th width='22%'>$ends_at</th>
    <th width='53%'>$percentage_added</th>
  </tr>
  <tr>
    <td width='25%' align='right'>$44.00</td>
    <td width='22%' align='right'>$220.00</td>
    <td width='53%'>+ 0%</td>
  </tr>
  <tr>
    <td width='25%' align='right'>$221.00</td>
    <td width='22%' align='right'>$440.00</td>
    <td width='53%'>+ 6%</td>
  </tr>
  <tr>
    <td width='25%' align='right'>$441.00</td>
    <td width='22%' align='right'>$880.00</td>
    <td width='53%'>+ 11%</td>
  </tr>
  <tr>
    <td width='25%' align='right'>$881.00</td>
    <td width='22%' align='right'>$1760.00</td>
    <td width='53%'>+ 14%</td>
  </tr>
  <tr>
    <td width='25%' align='right'>$1761.00</td>
    <td width='22%' align='right'>$2260.00</td>
    <td width='53%'>+ 17%</td>
  </tr>
  <tr>
    <td width='25%' align='right'>$2261.00</td>
    <td width='22%' align='right'>$3000.00</td>
    <td width='53%'>+ 20%</td>
  </tr>
</table>
<br><br>
$amount_example

";

?>
